<!DOCTYPE html>
<html lang="zh_CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>首页-生活博客</title>
  <!-- 引入图标 -->
  <link rel="shortcut icon" href="/favicon.ico" />
  <!-- 引入layui样式 -->
  <link rel="stylesheet" href="/layui/css/layui.css">
  <!-- 引入bootstrap样式 -->
  <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" rel="stylesheet">
  <!-- 引入首页样式 -->
  <link rel="stylesheet" href="/css/common.css">
  <style>
    .container [class^="col-md-3"] {
      transition: all .5s;
    }
    .container [class^="col-md-3"]:hover {
      transform: translateY(-8px);
    }
  </style>
</head>
<body>
  <div class="container-fluid bg-primary header">
    <div class="row">
      <div class="col-md-4">
        <div class="logo text-center">
          <a href="{{url('/')}}">
            <img src="logo.png" alt="">
          </a>
        </div>
      </div>
      <div class="col-md-8">
        <div class="user text-right pr-5">
          @if(isset($user))
          <a href="/admin/user/index">
          @if(isset($user->uimg))
            <img src="{{url('/'.$user->uimg)}}" class="rounded-circle mr-2" alt="">
          @else
            <i class="layui-icon-username layui-icon"></i>
          @endif
            <span>{{$user->uname}}</span>
          </a>
          @else
          <a href="{{url('/public/login')}}">登录</a> ｜ <a href="{{url('/public/register')}}">注册</a>
          @endif
        </div>
      </div>
    </div>
  </div>
  <div class="container mt-3">
    <div class="row">
      @foreach($articles as $article)
      <div class="col-md-3 my-2 shadow-sm">
        <div class="card shadow-sm rounded">
          <img src="{{url('/'.$article->path)}}" class="card-img-top" alt="...">
          <div class="card-body">
            <h5 class="card-title">{{$article->title}}</h5>
            <p class="card-text">{{$article->keyword}}</p>
            <a href="{{url('/admin/article/display/'.$article->id)}}" class="btn btn-primary">查看详情</a>
          </div>
        </div>
      </div>
      @endforeach
    </div>
  </div>
  <div class="container-fluid footer mt-3 pt-3 bg-secondary">
    <div class="contact float-right">
      <img src="imgs/contact.jpg" alt="">
    </div>
    <h2 class="text-white">生活博客-记录生活趣事</h2>
    <div class="copy">
      <p>友情链接 <a href="https://mirrors.aliyun.com">阿里云</a> ｜ 
        <a href="https://lmonkey.com">学习猿地</a> ｜
        <a href="https://baidu.com">百度</a>
      </p>
      <p>备案号京62824081412398998</p>
    </div>
  </div>
</body>
</html>